package com.zyong.design.pattern.memento.case1;

import java.util.ArrayList;
import java.util.List;

/**
 * @program: zyong-design-pattern
 * @ClassName: Caretaker
 * @author: zyong
 * @create: 2024-05-11 23:46
 */
public class Caretaker {
    private List<Memento> mementoList = new ArrayList<Memento>();

    public void add(Memento memento) {
        mementoList.add(memento);
    }

    /**
     * 获取到第index个Originator的备忘录对象
     * @param index
     * @return
     */
    public Memento get(int index) {
        return mementoList.get(index);
    }
}
